package com.survivor.game;

import java.util.*;

public class AStarComparator implements Comparator<int[][]> {
	GameContent game;

	public AStarComparator(GameContent game) {
		this.game = game;
	}

	public int compare(int[][] o1, int[][] o2) {
		int[] t1 = o1[1];
		int[] t2 = o2[1];
		int[] target = game.target;
		int a = (t1[0] - target[0]) * (t1[0] - target[0]) + (t1[1] - target[1])
				* (t1[1] - target[1]);
		int b = (t2[0] - target[0]) * (t2[0] - target[0]) + (t2[1] - target[1])
				* (t2[1] - target[1]);
		return a - b;
	}

	public boolean equals(Object obj) {
		return false;
	}
}